package com.mcxx.modules.miniSalvation.salary.service.write;

import com.mcxx.modules.miniSalvation.salary.dao.write.FamilySalaryChangeWriteDao;
import com.mcxx.modules.miniSalvation.salary.dao.write.MemberSalaryChangeWriteDao;
import com.mcxx.modules.miniSalvation.salary.entity.FamilySalaryChangeEntity;
import com.mcxx.modules.miniSalvation.salary.entity.MemberSalaryChangeEntity;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("familySalaryChangWriteService")
@TaTransactional
public class FamilySalaryChangWriteService {
    @Autowired
    private FamilySalaryChangeWriteDao familySalaryChangeWriteDao;
    @Autowired
    private MemberSalaryChangeWriteDao memberSalaryChangeWriteDao;

    public int deleteByOrderId(String orderId) {
        familySalaryChangeWriteDao.deleteByOrderId(orderId);
        return memberSalaryChangeWriteDao.deleteByOrderId(orderId);
    }


    public int insertMemberSalaryChange(MemberSalaryChangeEntity memberSalaryChangeEntity){
        return memberSalaryChangeWriteDao.insertMemberSalaryChange1(memberSalaryChangeEntity);
    }


    public int insertFamilySalaryChange(FamilySalaryChangeEntity familySalaryChange){
        return familySalaryChangeWriteDao.insertIgnoreNull(familySalaryChange);
    }


    public int batchInsert(List<FamilySalaryChangeEntity> changeList) {
        return familySalaryChangeWriteDao.batchInsert(changeList);
    }

}
